function _StringFormatInline() {
    var txt = this;
    for (var i = 0; i < arguments.length; i++) {
        var exp = new RegExp('\\{' + (i) + '\\}', 'gm');
        txt = txt.replace(exp, arguments[i]);
    }
    return txt;
}
function toueme(){
	document.getElementById("toubiao").style.display="none";
} 
function _StringFormatStatic() {
    for (var i = 1; i < arguments.length; i++) {
        var exp = new RegExp('\\{' + (i - 1) + '\\}', 'gm');
        arguments[0] = arguments[0].replace(exp, arguments[i]);
    }
    return arguments[0];
}

if (!String.prototype.format) {
    String.prototype.format = _StringFormatInline;
}

if (!String.format) {
    String.format = _StringFormatStatic;
}


function addfavorite(website,webname) {
	try{
		if (document.all) {
			window.external.addFavorite(website,webname);
		}else if (window.sidebar) {
			window.sidebar.addPanel(webname,website, "");
		}
	}catch(e){
		alert("收藏失败，请按ctrl+D进行操作，谢谢");
	}
}

function ds() {
    $("#desc").slideDown();
}

function MM_jumpMenu(targ,selObj,restore){ 
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
} 

function changeWebTitle($str){
	document.title=$str+"__风尚淘客程序后台管理系统";
}

function changeVisible(hidden,show){
	if(Object.prototype.toString.apply(hidden) === '[object Array]'){
		for(var i=0;i<hidden.length;i++){
			var h=document.getElementById(hidden[i]);
			h.style.display='none';
		}
	}else{
		var h=document.getElementById(hidden);
		h.style.display='none';
	}
	
	if(Object.prototype.toString.apply(show) === '[object Array]'){
		for(var i=0;i<show.length;i++){
			var s=document.getElementById(show[i]);
			s.style.display='block';
		}
	}else{
		var s=document.getElementById(show);
		s.style.display='block';
	}
}


function changeV(current,blurs,hidden,show){
	if(Object.prototype.toString.apply(current) === '[object Array]'){
		for(var i=0;i<current.length;i++){
			var h=document.getElementById(current[i]);
			h.className='selected';
		}
	}else{
		var h=document.getElementById(current);
		h.className='selected';
	}
	
	if(Object.prototype.toString.apply(blurs) === '[object Array]'){
		for(var i=0;i<blurs.length;i++){
			var s=document.getElementById(blurs[i]);
			s.className='';
		}
	}else{
		var s=document.getElementById(blurs);
		s.className='';
	}
	changeVisible(hidden,show);
}